
#ifndef __DATA_FORWARD__H
#define __DATA_FORWARD__H
#include "config.h"
#include "lora_data_package.h"
#ifdef GCC_DEBUG
#include <stdint.h>
#else 
#include "stm8l15x.h"
#include "485.h"
#endif
#include "lora_data_package.h"
#include<stdio.h>
#include<stdlib.h>
#include<string.h>

#define BUFFER_SIZE 1024
//#define LOCAL_TEST
void Lora_Data_Recv_Handler(uint8_t data);
void RS485_No_Data_Handler();
void RS485_Recv_Handler(uint8_t data);
typedef enum {
  PS_INIT_F, 
  PS_HEAD_F, 
  PS_HEAD_FOUND,
  PS_END_F,
  PS_END_FOUND
} DATA_PARSE_STATUS;

void Data_Parse(uint8_t data);
//Lora_Data_Pack * Package_Generate(uint8_t *pdata, int16_t len);
void Data_Parse(uint8_t data);
Validate_Status isPackageValid(uint8_t *pdata, int16_t len);
uint8_t CheckSum(uint8_t *pdata, int16_t len);
#endif
